package top.ajunnihao.core.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import top.ajunnihao.core.entity.User;
import top.ajunnihao.core.mapper.UserMapper;
import top.ajunnihao.core.service.UserService;

/**
 * TODO 用户业务层接口实现类
 *
 * @author AJun
 * @version 1.0.0
 * @date 2020/5/24
 */
@Service("userService")
public class UserServiceImpl implements UserService {

    @Autowired
    private UserMapper userMapper;

    @Override
    public User findUserByName(String name) {
        return userMapper.findUserByName(name);
    }

    @Override
    public boolean saveUser(User user) {
        return userMapper.saveUser(user) > 0;
    }

    @Override
    public boolean updateUser(User user) {
        return userMapper.updateUser(user) > 0;
    }

}
